package com.maimao.kill.client;

import com.maimao.core.constant.ServiceContainer;
import com.maimao.core.interceptor.FeignInterceptor;
import com.maimao.core.model.resp.Result;
import com.maimao.kill.client.fallback.GoodsCallBackFactory;
import com.maimao.kill.client.fallback.ShopFallBackFactory;
import com.maimao.model.goods.GoodsSku;
import com.maimao.model.kill.input.ApplySkuNewInput;
import com.maimao.model.user.Shop;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author MaoLin Wang
 * @date 2020/12/22 7:54 下午
 */
@RequestMapping("/goods/goods")
@FeignClient(value = ServiceContainer.GOODS_SERVICE, fallbackFactory = GoodsCallBackFactory.class, configuration = FeignInterceptor.class)
public interface GoodsClient {

    @PostMapping("/client/checkSkuIsNew")
    Result<ApplySkuNewInput> checkSkuIsNew(@RequestBody ApplySkuNewInput input);

    /**
     * 批量更新sku信息（这里为审核秒杀商品信息后更新sku秒杀信息）
     *
     * @param skus
     * @return
     */
    @PostMapping("/client/updateSkuBatch")
    Result<Void> updateSkuBatch(@RequestBody List<GoodsSku> skus);

    @PostMapping("/client/skuKillInfoBatch")
     Result<List<GoodsSku>> getSkuKillInfoBatch(@RequestBody List<Long> skuIds);
}
